function $(id){return document.getElementById(id)}
window.onload=function () {
    var a=1;
    $("ipt1").addEventListener("click", function () {
        $("div1").className = "xian";
        $("div2").className = "yin";
        $("all-1").style.backgroundColor = "gray";
        $("all-2").style.backgroundColor = "white";
        a=1;
    })
    $("ipt2").addEventListener("click", function () {
        $("div1").className = "yin";
        $("div2").className = "xian";
        $("all-1").style.backgroundColor = "white";
        $("all-2").style.backgroundColor = "gray";
        a=0;
    })
    $("but1").addEventListener("click", function (){

        if(a==1)
        {
            $("bot-1").className = "xian";
            $("bot-2").className = "yin";
            $("meiyuehuankuan").value=($("luochejiage").value*$("shoufubili").value+($("luochejiage").value*$("shoufubili").value*0.056)/2)/$("daikuaiqixian").value;
            $("lixizonghe").value=$("luochejiage").value*$("shoufubili").value*0.056/2;
            $("lijihuankuanzonge").value=$("luochejiage").value*$("shoufubili").value+($("luochejiage").value*$("shoufubili").value*0.056)/2;
        }
        else {
            $("bot-1").className = "yin";
            $("bot-2").className = "xian";
            $("xinchegouzhifei").value=$("cheliangpailiang").vlaue*100;
        }

    })
    $("but2").addEventListener("click", function (){
        $("luochejiage").value=" ";
    })
}